@import '../../custom.less';

@grid-cell-prefix-cls: ~'@{css-prefix}grid-cell';
@grid-cell-prefix: ~'@{css-prefix}grid';
@grid-checkbox-prefix-cls: ~'@{css-prefix}grid-checkbox';

.TextEllipsis() {
  @apply overflow-hidden;
  @apply text-ellipsis;
  @apply whitespace-nowrap;
  @apply pl-2;
  @apply box-border;
  line-height: 1.375rem;
}

.DefaultColumnHeight() {
  @apply h-9;
}

.MediumColumnHeight() {
  @apply h-10;
  @apply text-sm;
}

.SmallColumnHeight() {
  @apply h-9;
}

.MiniColumnHeight() {
  @apply h-8;
}

.CellEllipsis() {
  &:not(.col__actived) {
    .@{grid-cell-prefix-cls} {
      .TextEllipsis();
      line-height: 1.375rem;

      // 表头布局从block改为了flex，此处兼容插槽文本溢出不显示省略号问题
      &:not(:has(.tiny-grid-cell-text)) > span:only-of-type:not(.@{grid-cell-prefix}__expanded) {
        @apply text-ellipsis;
        @apply overflow-hidden;
      }

      & > .@{grid-checkbox-prefix-cls} {
        .TextEllipsis();
        line-height: 1.375rem;
        @apply pl-0;
      }
    }
  }
}
